package day0221;

public class Test5 {
    public static void main(String[] args) {//36人，
        for (int man = 0; man <= 9 ; man++) {
            for (int femail = 0; femail <=12 ; femail++) {
                double children=36-man-femail;//限制人数
                if(man*4 + femail*3 + children/2  == 36){//砖的数量
                    System.out.println(man+","+femail+","+children);
                }
            }
        }//3  3   30

        for (int g = 1; g <=20 ; g++) { //5
            for (int m = 1; m <33 ; m++) {//3
                int x=100-g-m;
                if(g*15 + m*9 + x == 300){
                    System.out.println(g+","+m+","+x);
                }
            }
        }





        //* * * * * * * * *
        //* * * * * *
        //* * *
        /*for (int i = 0; i < 3 ; i++) {
            for (int j = 1; j < ; j++) {  //i1  j<=9-3*0
                System.out.print("* ");   //i2  j<=9-3*1
            }                             //i3  j<=9-3*2
            System.out.println();
        }*/
        //*   *   *   *
        //  *   *   *
        //    *   *
        //      *

        //* 空  * 空  * 空  *      row 1    7-0*2
        //  *  空 *  空 *          row 2    7-1*2=5
        //     * 空  *            row  3   7-2*2=3
        //       *                row 4    7-3*2=1
        for (int row = 0; row < 4 ; row++) {//row0  0个
            //                              row1  1个
            for(int i=0;  i<row;  i++){//本行有几个空格            row2  2个
                System.out.print(" ");
            }

            for (int col = 1; col <= 7-row*2; col++) {
                if(col%2!=0){//如果本行要打印第1个或第7-row*2个就打印1 (否则打印 "*")
                    if(col==1  || col==7-row*2){//col是1或者col是7-row*2相等
                        System.out.print("1");
                    }else{
                        System.out.print("*");
                    }
                }else{
                    System.out.print(" ");
                }
            }
            System.out.println();
        }





    }
}
